//
//  MenuViewController.m
//  CareGiver
//
//  Created by Guillermo Moral on 7/30/14.
//  Copyright (c) 2014 Humana. All rights reserved.
//

#import "MenuViewController.h"

@interface MenuViewController ()

@end

NSString *const LocalizedAnalyticsFile = @"Analitics";
static NSString *const kLocalizedMenuStringFile = @"Menu";

@implementation MenuViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view
    self.delegate = self;
    self.view.backgroundColor = [UIColor grayColor];
    [self configureTabBar];
    [self setSelectedIndex:2];
}

#pragma mark View Customization

-(void)configureTabBar {
    self.tabBar.tintColor = [UIColor blueColor];
    [[self.tabBar.items objectAtIndex:0] setTitle:NSLocalizedStringFromTable(@"Tab1ItemTitle", kLocalizedMenuStringFile, nil)];
    [[self.tabBar.items objectAtIndex:1] setTitle:NSLocalizedStringFromTable(@"Tab2ItemTitle", kLocalizedMenuStringFile, nil)];
    [[self.tabBar.items objectAtIndex:2] setTitle:NSLocalizedStringFromTable(@"Tab3ItemTitle", kLocalizedMenuStringFile, nil)];
    [[self.tabBar.items objectAtIndex:3] setTitle:NSLocalizedStringFromTable(@"Tab4ItemTitle", kLocalizedMenuStringFile, nil)];
}

#pragma mark UITabBarControllerDelegate
-(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
    UINavigationController *nv = (UINavigationController*)viewController;
    [nv popToRootViewControllerAnimated:YES];
}

-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
    //UINavigationController *nv = (UINavigationController*)self.selectedViewController;
    return YES;
}

-(void)setSelectedIndex:(NSUInteger)selectedIndex {
    [super setSelectedIndex:selectedIndex];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
